function Get-AzureParameters {
    [CmdletBinding()]
    [OutputType('Parameters')]
    param (
        [Parameter(Mandatory = $false)][Parameters]$Parameters = (New-LSParameters)
    )

    # Get Subscription Id.
    $Parameters.Azure.SubscriptionId = Get-SubscriptionId -SubscriptionId $Parameters.Azure.SubscriptionId -ConfirmAll $Parameters.ConfirmAll

    # Connect to Azure.
    Connect-Azure $Parameters

    # Get Resource group.
    $Parameters.Azure.ResourceGroup = Get-ResourceGroup -ResourceGroup $Parameters.Azure.ResourceGroup -ConfirmAll $Parameters.ConfirmAll

    # Store 'Parameters' object in the project folder.
    if ($Parameters.LSInsight.ParametersOutFilePath) {
        Write-LSParameters -Parameters $Parameters -File $Parameters.LSInsight.ParametersOutFilePath
    }
    
    return $Parameters
}